//
//  ReflectDetailViewController.m
//  cooba-iOS
//
//  Created by 郭四虎 on 16/9/13.
//  Copyright © 2016年 YouKu. All rights reserved.
//

#import "ReflectDetailViewController.h"

@interface ReflectDetailViewController ()
@property (weak, nonatomic) IBOutlet UILabel *ID;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *money;

@property (weak, nonatomic) IBOutlet UILabel *begainTime;
@property (weak, nonatomic) IBOutlet UILabel *nowTime;
@property (weak, nonatomic) IBOutlet UILabel *endTime;

@property (weak, nonatomic) IBOutlet UIView *begeinV;
@property (weak, nonatomic) IBOutlet UILabel *nowV;
@property (weak, nonatomic) IBOutlet UILabel *endV;

@property (weak, nonatomic) IBOutlet UILabel *nowLb;
@property (weak, nonatomic) IBOutlet UILabel *endLb;

@property (weak, nonatomic) IBOutlet UILabel *msg;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *nowWidth;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *endWidth;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *msgHeight;

@end

@implementation ReflectDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    _ID.text = [NSString stringWithFormat:@"支付宝账号：%@",[[Myuser sharedUser].login_id stringByReplacingCharactersInRange:NSMakeRange(3, 4) withString:@"****"]];
    _name.text = [NSString stringWithFormat:@"姓名：%@",_data[@"name"]];
    _money.text = [NSString stringWithFormat:@"提现金额：%@",_data[@"money"]];
    _begainTime.text = [MyDateformater formater:_data[@"time"]];
    
    NSDateFormatter *formater = [[NSDateFormatter alloc]init];
    [formater setDateFormat:@"yyyy-MM-dd HH:mm"];
    _nowTime.text = [formater stringFromDate:[NSDate date]];
    _begeinV.layer.borderWidth = 2;
    _begeinV.layer.borderColor = RGBcolor(106, 195, 9).CGColor;
    _nowV.layer.borderWidth = 2;
    _nowV.layer.borderColor = RGBcolor(106, 195, 9).CGColor;
    _endV.layer.borderWidth = 2;
    _endV.layer.borderColor = RGBcolor(106, 195, 9).CGColor;
    if (![_data[@"status1"]integerValue]) {
        //未打款
        _endV.hidden = YES;
        _endLb.hidden = YES;
        _endTime.hidden = YES;
        
        _nowWidth.constant = 30;
        _nowV.layer.cornerRadius = 15;
        _nowV.layer.borderWidth = 4;
        _nowLb.textColor = RGBcolor(106, 195, 9);
        
        _msg.text = @"提现申请审核中";
    }else{
        
        _nowTime.hidden = YES;
        
        _endTime.text = [MyDateformater formater:_data[@"detail_time"]];
        _endWidth.constant = 30;
        _endV.layer.cornerRadius = 15;
        _endV.layer.borderWidth = 4;
        if ([_data[@"status1"]integerValue]==1) {
            _msg.text = @"提现操作已完成";
        }else{
            _endLb.text = @"提现失败";
            _endLb.textColor = [UIColor redColor];
            
            _msg.text = _data[@"remark"];
            _msg.textColor = [UIColor redColor];
            _msgHeight.constant = sizeForLabel(_msg, WIDTH-40).height;
        }
    }
                        
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
